package cn.dogger.easyboot.login.exception;

import cn.dev33.satoken.exception.NotLoginException;
import cn.dogger.easyboot.common.result.AjaxResult;
import cn.dogger.easyboot.common.result.constant.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * 未登录异常处理
 * @author dogger
 * 2022/4/16 16:06
 */
public class NoLoginException {

    @ExceptionHandler(NotLoginException.class)
    public AjaxResult noLoginException(NotLoginException e){
        return AjaxResult.error(HttpStatus.NO_LOGIN,e.getMessage());
    }

}
